<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
	localStorage.name = "daishi";

	var c = $("#c").get(0);
	var context = c.getContext("2d");
	
	$("#c").click(function(e) {
		console.log(e);
		context.strokeRect(e.offsetX-10, e.offsetY-10, 20, 20);
	});
	$("#b").click(function() {
		var data = c.toDataURL();
		localStorage.data = data;
	});
});
</script>
</head>
<body style="background:black">
<canvas id="c" width="500px" height="500px" style="background:white;width:500px;height:500px"></canvas><br />
<button id="b">save</button>
</body>
</html>